//
//  WQVisitorController.m
//  sanwuWeiboOC
//
//  Created by 王先强 on 15/12/6.
//  Copyright © 2015年 王先强. All rights reserved.
//

#import "WQVisitorController.h"
#import "WQOAuthController.h"
#import "WQVisitorView.h"
#import "WQNetTool.h"
@interface WQVisitorController ()<WQVisitorViewDelegate>
@property (nonatomic, assign) BOOL logonState;
@end

@implementation WQVisitorController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}


-(void)loadView{
    self.logonState ? [super loadView] : [self setupView];
}

-(void) setupView{
    self.visitorView = [[WQVisitorView alloc] init];
    self.view = self.visitorView;
    self.visitorView.delegate = self;

}

-(void)visitorView:(WQVisitorView *)visitorView didClickedLoginButton:(UIButton *)loginButton{
    
    WQOAuthController *oaVc = [[WQOAuthController alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:oaVc];
    oaVc.title = @"登陆新浪微博";
    [self presentViewController:nav animated:YES completion:nil];

}
-(void)visitorView:(WQVisitorView *)visitorView didClickedRegisterButton:(UIButton *)registerButton{
    
    
        WQLog(@"registerButtonDidClicked");

}
@end
